//
//  ActivityTests.m
//  ActivityTests
//
//  Created by its on 15/5/7.
//  Copyright (c) 2015年 coco. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
#import "CCCommentModel.h"

#define AVOSCloudAppID  @"vgm655n2kxn4knm0t6iqbvszc9dew2q50fz0v2ma5oln5s1e"
#define AVOSCloudAppKey @"q33a2gzrwex6o5pwg0khmee947xqyunxjuoudseqd1nw2jrw"

@interface ActivityTests : XCTestCase

@end

@implementation ActivityTests

- (void)setUp {
  
    [super setUp];
    // Put setup code here. This method is called before the invocation of each test method in the class.
}

- (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}

- (void)testExample {
    // This is an example of a functional test case.
    XCTAssert(YES, @"Pass");
}

- (void) testThree {
  NSString *str1 = @"1";
  NSString *str2 = @"1";
  XCTAssertFalse(![str1 isEqualToString:str2], @"oneStr:%@, twoStr:%@", str1, str2);
}
- (void)testPerformanceExample {
    // This is an example of a performance test case.
    [self measureBlock:^{
//      NSString *str1 = @"1";
//      NSString *str2 = @"1";
//      XCTAssertFalse(![str1 isEqualToString:str2], @"oneStr:%@, twoStr:%@", str1, str2);
//
    }];
}
- (void) testComment {
  XCTestExpectation *commentExcepctation = [self expectationWithDescription:@"comment exception"];
  [AVOSCloud setApplicationId:AVOSCloudAppID clientKey:AVOSCloudAppKey];
  [AVUser logInWithMobilePhoneNumberInBackground:@"18680306621" password:@"123456" block:^(AVUser *user, NSError *error) {
    if (!error) {
      CCPublicComment *comment = [[CCPublicComment alloc] init];
      comment.author = user;
      comment.parent = [AVObject objectWithoutDataWithClassName:@"comment" objectId:@"5562de21e4b00c57d9ba6b3a"];
      comment.content = @"这是一条测试数据，我是不会告诉你的，啊哈哈哈哈哈！！";
      comment.activity = @"55558903e4b0a343c5c0089f";
      CCCommentModel *model = [[CCCommentModel alloc] init];
//      [[model pullComment: comment] subscribeNext:^(id x) {
//        [commentExcepctation fulfill];
//      }];
    } else {
      NSLog(@"登录失败");
     [commentExcepctation fulfill];
    }
  }];
  [self waitForExpectationsWithTimeout:100 handler:^(NSError *error) {
    NSLog(@"hahah");
  }];
}


@end
